package com.zx.mobile.service.proxy;

import org.apache.commons.lang3.StringUtils;

import com.zx.mobile.domain.pingan.SendVerifyCodeRequest;

public class PASendVerifyCodeCommonProxy {

    /**
     * 平安短信发送合法性校验
     *
     * @return
     */
    public static String checkSendVerify(SendVerifyCodeRequest sendVerifyCodeRequest) {        
        if (StringUtils.isBlank(sendVerifyCodeRequest.getPartnerId())) {
            return "输入项必填";
        }
        if (StringUtils.isBlank(sendVerifyCodeRequest.getSign())) {
            return "输入项必填";
        }
        if (StringUtils.isBlank(sendVerifyCodeRequest.getUserId())) {
            return "输入项必填";
        }
        //签名验证
        if (!PASignHelper.checkRequestSign(sendVerifyCodeRequest, sendVerifyCodeRequest.getSign())) {
            return "签名验证失败";
        }
        return null;
    }
}
